import http from '@http';

const API_PREFIX = '/system/role';

export function fetchGetRoleList(values = {}) {
  return http.post(API_PREFIX + '/list', values);
}

export function fetchGetRole(roleId) {
  return http.get(API_PREFIX + `/detail/${roleId}`);
}

export function fetchAddRole(params) {
  return http.post(API_PREFIX + '/insert', params);
}

export function fetchUpdateRole(params) {
  return http.post(API_PREFIX + '/update', params);
}

export function fetchUpdateRoleStatus(params) {
  return http.post(API_PREFIX + '/update/status', params);
}

export function fetchDeleteRole(ids) {
  return http.post(API_PREFIX + '/delete', ids);
}

export function fetchGetExportParams() {
  return http.get(API_PREFIX + '/export/params');
}

export function fetchExportRole(params = {}) {
  return http.post(API_PREFIX + '/export', params);
}
